import request from "@/utils/request";
import axios from "axios"; //用于验证码的直接请求

export function getNext() {
  return request({ url: "/user/puser", method: "post" });
}

export function getList(query) {
  return request({
    url: "/user/userlist",
    method: "post",
    params: query
  });
}

export function getTJList(query) {
  return request({
    url: "/user/getTJList",
    method: "post",
    params: query
  });
}

export function delUser(query) {
  return request({
    url: "/user/delUser",
    method: "post",
    params: query
  });
}

export function adminEditUser(query) {
  return request({ url: "/user/editUserAdmin", method: "post", params: query });
}

export function getTJday(query) {
  return request({ url: "/user/getTJday", method: "post", params: query });
}

export function updateUser(query) {
  return request({ url: "/user/updateUser", method: "post", params: query });
}

export function binduser(query) {
  return request({
    url: "/user/bindUser",
    method: "post",
    params: query
  });
}

export function getIndexInfo(query) {
  return request({
    url: "/user/getIndexInfo",
    method: "post",
    params: query
  });
}

//发送手机验证码
export function postChkCode(tel) {
  // return request({
  //   url: "http://test.tmcapi.tripg.com/index.php/commonApi/mobileApi/sendMsg",
  //   method: "post",
  //   params: { telphone: tel },
  //   responseType: "text"
  // });

  return axios({
    url: "http://test.tmcapi.tripg.com/index.php/commonApi/mobileApi/sendMsg",
    method: "post",
    params: { telphone: tel },
    responseType: "text"
  });
}
